package com.salary.system;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class FileUtil {
    public static void savePaySlip(String paySlip, String filename) {
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename, true))) {
            writer.write(paySlip);
            writer.newLine();
            writer.newLine();
            System.out.println("工资条已保存到：" + filename);
        } catch (IOException e) {
            System.out.println("文件保存失败：" + e.getMessage());
        }
    }
}